// 错误示例
let condition: boolean = true;
if (condition) console.log("success");
for (let idx: number = 0; idx < 5; idx++) console.log(idx);

const arr: number[] = [1, 2, 3, 4, 5];
for (const num of arr) console.log(num);
for (const num2 in arr) console.log(num2);
while (condition) console.log(1);
do console.log(2);
while (condition);

// 正确示例
let show: boolean = true;
if (show) {
  console.log(1);
}
for (let i = 0; i < 5; i++) {
  console.log(i);
}
while (condition) {
  console.log(1);
}
do {
  console.log(2);
} while (condition);
